<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<div th:fragment="collapse(sourceType,source,hideCancel)" class="collapse widget-comments mb-20" th:id="|comments-${sourceType}-${source.id}|" th:attr="data-source_type=|${sourceType}|,data-source_id=|${source.id}|"   >
    <div class="widget-comment-list"></div>
    <div th:if="${currentUser!=null}" class="widget-comment-form row">
        <form class="col-md-12" >
            <div class="form-group">
                <textarea name="content" placeholder="写下你的评论" class="form-control" th:id="|comment-${sourceType}-content-${source.id}|"></textarea>
            </div>
        </form>
        <div class="col-md-12 text-right">
            <a th:if="!${hideCancel}" href="#" class="text-muted collapse-cancel" th:attr="data-collapse_id=|comments-${sourceType}-${source.id}|">取消</a>
            <button type="submit" class="btn btn-primary btn-sm ml-10 comment-btn" th:id="|${sourceType}-comment-${source.id}-btn|"   th:attr="data-source_type=|${sourceType}|,data-source_id=|${source.id}|,data-token=|${_csrf.token}|" data-to_user_id="0">提交评论</button>
        </div>
    </div>
    <div th:if="${currentUser==null}" class="widget-comment-form row">
        <div class="col-md-12">
            请先 <a  href="javascript:void(0)" onclick="check_login()">登录</a> 后评论
        </div>
    </div>
</div>